// 用户请求相关模块
import request from '../uilts/request'
// 导入vex
// import store from '@/store'
// console.log(store.state.user.token);
// 登录函数
export const login = data => {
        return request({
            method: 'POST',
            url: '/v1_0/authorizations',
            data
        })
    }
    // 发送验证码
export const sendSms = mobile => {
        return request({
            method: 'get',
            url: `/v1_0/sms/codes/${mobile}`
        })
    }
    // 获取用户的信息
export const getUser = () => {
        return request({
            method: 'get',
            url: '/v1_0/user'
                // headers: {
                //     Authorization: `Bearer ${store.state.user.token}`
                // }
        })
    }
    // 获取用户频道列表
export const getChannal = () => {
        return request({
            method: 'get',
            url: '/v1_0/user/channels'
                // headers: {
                //     Authorization: `Bearer ${store.state.user.token}`
                // }
        })
    }
    // 获取用户个人资料
export const getUserProfile = () => {
        return request({
            method: 'get',
            url: '/v1_0/user/profile'
        })
    }
    // 修改用户昵称
export const updateUserName = data => {
    return request({
        method: 'PATCH',
        url: '/v1_0/user/profile',
        data
    })
}
export const updateUserPhoto = data => {
    return request({
        method: 'PATCH',
        url: '/v1_0/user/photo',
        data
    })
}